﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="NtpChat.Client.MessageView"
	x:Name="UserControl"
	UseLayoutRounding="True"
	d:DesignWidth="640" d:DesignHeight="480" Template="{DynamicResource ChatTemplate1}">
	<UserControl.Resources>
		<ControlTemplate x:Key="ChatTemplate1" TargetType="{x:Type UserControl}">
			<Border MinWidth="300" MinHeight="60" MaxWidth="400" BorderThickness="1" CornerRadius="6" BorderBrush="#FFADADAD" VerticalAlignment="Top" HorizontalAlignment="Left" MaxHeight="100" d:LayoutOverrides="HorizontalAlignment, VerticalAlignment" Margin="4">
				<Border.Background>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<LinearGradientBrush.RelativeTransform>
							<TransformGroup>
								<ScaleTransform CenterY="0.5" CenterX="0.5"/>
								<SkewTransform CenterY="0.5" CenterX="0.5"/>
								<RotateTransform Angle="90" CenterY="0.5" CenterX="0.5"/>
								<TranslateTransform/>
							</TransformGroup>
						</LinearGradientBrush.RelativeTransform>
						<GradientStop Color="#FF498F2E"/>
						<GradientStop Color="White" Offset="1"/>
						<GradientStop Color="#5995DE78" Offset="0.664"/>
					</LinearGradientBrush>
				</Border.Background>
				<DockPanel HorizontalAlignment="Stretch">
					<TextBlock TextWrapping="Wrap" Text="{Binding Content}" DockPanel.Dock="Right" Margin="5" TextAlignment="Right"/>
					<Image HorizontalAlignment="Left" Margin="5,0,10,0" DockPanel.Dock="Right" Width="45" Height="45" Source="person.jpg">
						<Image.OpacityMask>
							<RadialGradientBrush>
								<GradientStop Color="Black" Offset="0"/>
								<GradientStop Color="#60FFFFFF" Offset="1"/>
							</RadialGradientBrush>
						</Image.OpacityMask>
					</Image>
				</DockPanel>
			</Border>
		</ControlTemplate>
		<ControlTemplate x:Key="ChatTemplate2" TargetType="{x:Type UserControl}">
			<Border MinWidth="300" MinHeight="60" MaxWidth="400" BorderThickness="1" CornerRadius="6" BorderBrush="#FFADADAD" VerticalAlignment="Top" HorizontalAlignment="Left" MaxHeight="100" d:LayoutOverrides="HorizontalAlignment, VerticalAlignment" Margin="4">
				<Border.Background>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<LinearGradientBrush.RelativeTransform>
							<TransformGroup>
								<ScaleTransform CenterY="0.5" CenterX="0.5"/>
								<SkewTransform CenterY="0.5" CenterX="0.5"/>
								<RotateTransform Angle="90" CenterY="0.5" CenterX="0.5"/>
								<TranslateTransform/>
							</TransformGroup>
						</LinearGradientBrush.RelativeTransform>
						<GradientStop Color="#FF4B9FA5" Offset="0.991"/>
						<GradientStop Color="White"/>
						<GradientStop Color="#5978A7DE" Offset="0.336"/>
					</LinearGradientBrush>
				</Border.Background>
				<DockPanel HorizontalAlignment="Stretch">
					<Image HorizontalAlignment="Left" Margin="5,0,10,0" DockPanel.Dock="Right" Width="45" Height="45" Source="person.jpg">
						<Image.OpacityMask>
							<RadialGradientBrush>
								<GradientStop Color="Black" Offset="0"/>
								<GradientStop Color="#60FFFFFF" Offset="1"/>
							</RadialGradientBrush>
						</Image.OpacityMask>
					</Image>
					<TextBlock TextWrapping="Wrap" Text="{Binding Content}" DockPanel.Dock="Left" Margin="5" TextAlignment="Left"/>
				</DockPanel>
			</Border>
		</ControlTemplate>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot"/>
</UserControl>